<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAttachmentableTable extends Migration {
  /**
   * Run the migrations.
   *
   * @return void
   */
  public function up() {
    Schema::create( 'attachmentables', function ( Blueprint $table ) {
      $table->integer( 'attachment_id' )->unsigned();
      $table->integer( 'attachmentable_id' )->unsigned();
      $table->string( 'attachmentable_type', 40 );
    } );
  }

  /**
   * Reverse the migrations.
   *
   * @return void
   */
  public function down() {
    Schema::dropIfExists( 'attachmentables' );
  }
}
